From 9e574f08eee8e15cb7f1e8240463ace0d529dbdf Mon Sep 17 00:00:00 2001
From: Ilion Beyst <ilion.beyst@gmail.com>
Date: Sat, 10 Sep 2022 18:57:38 +0200
Subject: show bot versions on bot page

---
 web/pw-server/src/routes/code/[bundle_id].svelte | 35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 web/pw-server/src/routes/code/[bundle_id].svelte

(limited to 'web/pw-server/src/routes/code/[bundle_id].svelte')

diff --git a/web/pw-server/src/routes/code/[bundle_id].svelte b/web/pw-server/src/routes/code/[bundle_id].svelte
new file mode 100644
index 0000000..1775ba5
--- /dev/null
+++ b/web/pw-server/src/routes/code/[bundle_id].svelte
@@ -0,0 +1,35 @@
+<script lang="ts" context="module">
+  import { ApiClient } from "$lib/api_client";
+
+  export async function load({ params, fetch }) {
+    const apiClient = new ApiClient(fetch);
+
+    try {
+      const code = await apiClient.getText(`/api/code/${params["bundle_id"]}`);
+      return {
+        props: {
+          code,
+        },
+      };
+    } catch (error) {
+      return {
+        status: error.status,
+        error: error,
+      };
+    }
+  }
+</script>
+
+<script lang="ts">
+  export let code;
+</script>
+
+<pre class="bot-code">
+  {code}
+</pre>
+
+<style lang="scss">
+  .bot-code {
+    margin: 24px 12px;
+  }
+</style>
-- 
cgit v1.2.3

